﻿namespace Preactor.ObjectModel.BaseTypes.MaterialControl
{
    using System;

    using Preactor.ObjectModel.Attributes;
    using Preactor.ObjectModel.Entities;
    using Preactor.ObjectModel.Interfaces.MaterialControl;

    public class OrderLink : PreactorRecord, IOrderLink
    {
        public OrderLink(PrimaryKey id, PreactorObjectModel preactorObjectModel)
            : base(id, preactorObjectModel)
        {
        }

        [PreactorField("LINKS TABLE", FieldDeclarationType.FieldClassification)]
        public int Number { get { return (int)GetValue("Number"); } set { SetValue("Number", value); } }

        [PreactorField("EXTERNAL SUPPLY KEY", FieldDeclarationType.FieldClassification)]
        public int FromExternalSupplyOrder { get { return (int)GetValue("FromExternalSupplyOrder"); } set { SetValue("FromExternalSupplyOrder", value); } }

        [PreactorField("INTERNAL SUPPLY KEY", FieldDeclarationType.FieldClassification)]
        public int FromInternalSupplyOrder { get { return (int)GetValue("FromInternalSupplyOrder"); } set { SetValue("FromInternalSupplyOrder", value); } }

        [PreactorField("EXTERNAL DEMAND KEY", FieldDeclarationType.FieldClassification)]
        public int ToExternalDemandOrder { get { return (int)GetValue("ToExternalDemandOrder"); } set { SetValue("ToExternalDemandOrder", value); } }

        [PreactorField("INTERNAL DEMAND KEY", FieldDeclarationType.FieldClassification)]
        public int ToInternalDemandOrder { get { return (int)GetValue("ToInternalDemandOrder"); } set { SetValue("ToInternalDemandOrder", value); } }

        [PreactorField("MATERIAL CONTROL PART NO", FieldDeclarationType.FieldClassification)]
        public string PartNumber { get { return (string)GetValue("PartNumber"); } set { SetValue("PartNumber", value); } }

        [PreactorField("QUANTITY", FieldDeclarationType.FieldClassification)]
        public double Quantity { get { return (double)GetValue("Quantity"); } set { SetValue("Quantity", value); } }

        [PreactorField("PEGGING RULE USED", FieldDeclarationType.FieldClassification)]
        public string PeggingRuleUsed { get { return (string)GetValue("PeggingRuleUsed"); } set { SetValue("PeggingRuleUsed", value); } }

        [PreactorField("MATERIAL CONTROL VERIFICATION CODE", FieldDeclarationType.FieldClassification)]
        public int VerificationCode { get { return (int)GetValue("VerificationCode"); } set { SetValue("VerificationCode", value); } }

        [PreactorField("LINK LOCKED", FieldDeclarationType.FieldClassification)]
        public bool Locked { get { return (bool)GetValue("Locked"); } set { SetValue("Locked", value); } }
    }
}